package com.zzy.study.antJunit;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;


public class AntDemoTest {
	private AntDemo ad = null;

	@Before
	public void setUp() {
		this.ad = new AntDemo();
	}

	@Test
	public void testSave() {
		assertTrue("插入数据失败！", this.ad.save());
	}

	@Test
	public void testDelete() {
		assertFalse("删除数据成功！", this.ad.delete());
	}

	@Test
	public void testUpdate() {
		assertEquals("更新数据失败！", 1, this.ad.update());
	}

	@Test
	public void testFindAll() {
		assertNotNull("查询结果为null", this.ad.findAll());
	}

	@Test
	public void testFindById() {
		assertNotNull("查询结果为null", this.ad.findById(10));
	}

	@After
	public void tearDown() {
		this.ad = null;
	}
}